const util = require('../../../utils/util.js')
Page({
    data: {
        isVoucher: ''
    },
    props: {
        proId: ''
    },
    onLoad: function (options) {
        const { proId, isVoucher } = options
        this.judgeVoucher(isVoucher)
        this.props.proId = proId
    },
    judgeVoucher(isVoucher) {
        if (isVoucher) {
            this.setData({
                isVoucher: false
            })
        } else {
            this.setData({
                isVoucher: true
            })
        }
    },
    toBack() {
        wx.switchTab({
          url: '/pages/Index/index/index',
        })
    },
    toWriteVoucher() {
        wx.navigateTo({
          url: '/pages/Index/proVoucher/proVoucher?proId=' + this.props.proId,
        })
    }
})